package chapter5;

public class Recursive {
    public static void main(String[] args) {
        int result = fn(10);
        System.out.println(result);
    }
    //递归函数
    public static int fn(int n) {
        if(n == 0) {
            return 1;
        } else if(n == 1) {
            return 4;
        } else {
            return 2 * fn(n - 1) + fn(n - 2);
        }
    }
}
